package ;
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
#end
/**
 * ...
 * @author 
 */

class MyMacro {
	@:macro public static function doIt ():Array<Field> {
		
		var e = Context.parse("MyMacro.auto(Bug.Hui)", Context.currentPos());
		
		var t = Context.getLocalClass();
		
		t.get().meta.add(":autoBuild", [e], Context.currentPos());
		
		
		return Context.getBuildFields();
	}
	@:macro public static function auto (e:Expr):Array<Field> {
		
		return Context.getBuildFields();
	}
}

#if !macro

@:build(MyMacro.doIt())
interface Hui {
	
}

class Bug 
{
	public static function test () {
		trace("foo");
	}
	
	public static function main() 
	{
		//MyMacro.doIt();
	}
	
	
}

class Bug1 implements Hui{}

#end

